/*-------------------------------------------------------------------------
 *
 * pg_foreign_data_wrapper.h
 *	  "外部数据包装器" 系统目录 (pg_foreign_data_wrapper) 的定义
 *
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/catalog/pg_foreign_data_wrapper.h
 *
 * NOTES
 *	  Catalog.pm 模块读取此文件并推导模式
 *	  信息。
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_FOREIGN_DATA_WRAPPER_H
#define PG_FOREIGN_DATA_WRAPPER_H

#include "catalog/genbki.h"
#include "catalog/pg_foreign_data_wrapper_d.h"

/* ----------------
 *		pg_foreign_data_wrapper 定义。 cpp 将其转换为
 *		typedef struct FormData_pg_foreign_data_wrapper
 * ----------------
 */
CATALOG(pg_foreign_data_wrapper,2328,ForeignDataWrapperRelationId)
{
	Oid			oid;			/* oid */
	NameData	fdwname;		/* 外部数据包装器名称 */
	Oid			fdwowner BKI_LOOKUP(pg_authid); /* FDW 所有者 */
	Oid			fdwhandler BKI_LOOKUP_OPT(pg_proc); /* 处理函数，或 0
													 * 如果没有 */
	Oid			fdwvalidator BKI_LOOKUP_OPT(pg_proc);	/* 选项验证
														 * 函数，或 0 如果
														 * 没有 */

#ifdef CATALOG_VARLEN			/* 可变长度字段从这里开始 */
	aclitem		fdwacl[1];		/* 访问权限 */
	text		fdwoptions[1];	/* FDW 选项 */
#endif
} FormData_pg_foreign_data_wrapper;

/* ----------------
 *		Form_pg_foreign_data_wrapper 对应于指向具有 pg_foreign_data_wrapper 关系格式的元组的指针。
 * ----------------
 */
typedef FormData_pg_foreign_data_wrapper *Form_pg_foreign_data_wrapper;

DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150);

DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_data_wrapper_oid_index, 112, ForeignDataWrapperOidIndexId, on pg_foreign_data_wrapper using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_name_index, 548, ForeignDataWrapperNameIndexId, on pg_foreign_data_wrapper using btree(fdwname name_ops));

#endif							/* PG_FOREIGN_DATA_WRAPPER_H */
